package com.mofang.powerdekorhelper.adapter;

import android.content.Context;

import com.mofang.powerdekorhelper.R;
import com.mofang.powerdekorhelper.base.recycleview.BaseRecycleViewAdapter;
import com.mofang.powerdekorhelper.base.recycleview.BaseViewHolder;
import com.mofang.powerdekorhelper.model.ShopActive;

import java.util.List;

/**
 * Created by luofei on 2017/7/13 0013.
 */

public class ShopActivityAdapter extends BaseRecycleViewAdapter {

    public ShopActivityAdapter(List<?> data, Context mContext, int layoutId) {
        super(data, mContext, layoutId);
    }

    @Override
    protected <T> void convert(BaseViewHolder holder, T bean, int position) {

        ShopActive.Data data = (ShopActive.Data) bean;
        holder.setImage(R.id.shop_active_list_item_imv, data.getImage(), R.mipmap.list_defaut_bg);
        holder.setText(R.id.shop_active_list_item_tv, data.getTitle());

        holder.itemView.setTag(data);
    }

    public void addData(List<ShopActive.Data> datas) {
        mData.addAll(datas);
        notifyDataSetChanged();
    }
}
